//
//  MyReplyCell.m
//  TuYouAPP
//
//  Created by L on 14-2-27.
//
//

#import "MyReplyCell.h"

@implementation MyReplyCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}
-(void)upDateCell:(NSString *)first content:(NSString *)content
{
    
    CGSize constraint = CGSizeMake(290, CGFLOAT_MAX);
    CGSize size ;
    CGRect rect;
    

    size = [first sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
    rect = self.firstReply.frame;
    rect.origin.y = 25;
    rect.size.height = size.height+5;
    
    
    self.firstReply.frame = rect;

    rect = self.xian.frame;
    
    rect.origin.y = self.firstReply.frame.size.height + self.firstReply.frame.origin.y+5;
    self.xian.frame = rect;
    
    rect = self.headImage.frame;
    rect.origin.y = self.xian.frame.size.height+self.xian.frame.origin.y +10;
    self.headImage.frame = rect;
    
    
    rect = self.contentName.frame;
    rect.origin.y = self.headImage.frame.origin.y-7;
    self.contentName.frame = rect;
    
    rect.origin.y = self.headImage.frame.origin.y+13;
    
    
     constraint = CGSizeMake(230, CGFLOAT_MAX);
    size = [content sizeWithFont:[UIFont systemFontOfSize:15] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
    if (size.height > 36) {
        rect.size.height = size.height+15;
    }
    else
    {
        rect.size.height = size.height ;
    }
    self.content.frame = rect;
    
    
    
    rect = self.frame;
    rect.size.height  = self.content.frame.size.height + self.content.frame.origin.y+20;
    self.frame = rect;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
